import 'package:flutter/material.dart';
import '../bean/detail_goods_bean.dart';
import '../service/service_method.dart';

class DetailInfoProvide with ChangeNotifier {
  GoodsDetailBean goodsInfo;
  bool isLeft = true;
  bool isRight = false;

  //从后台读取信息
  getGoodsInfo(String id) {
    var formData = {'itemId': id};
    request('getGoodsDetail', formData).then((value) {
      goodsInfo = GoodsDetailResult.fromJson(value).entity;
      print('================>${goodsInfo.goods_name}');
      print('================>${goodsInfo.goods_id}');
      notifyListeners();
    });
  }

  //改变tabBar的状态
  changeLeftAndRight(String changeState) {
    if (changeState == 'left') {
      isLeft = true;
      isRight = false;
    } else {
      isLeft = false;
      isRight = true;
    }
    notifyListeners();
  }
}
